<!--
 * @Author       : xiangmin
 * @File         : 用途
 * @Interface    : 接口文档
 * @Product      : 需求文档
 * @Date         : 2023-08-18 19:44:10
 * @LastEditors  : xiangmin
 * @LastEditTime : 2024-09-19 09:59:17
-->
<template>
	<a-modal
		:confirm-loading="loading"
		v-model:open="open"
		title="Basic------Modal"
		@ok="handleOk"
	>
		<p>Some contents...</p>
		<p>Some contents...</p>
		<p>Some contents...</p>
	</a-modal>
</template>

<script setup lang="ts">
import { useWatchModal } from '@/hooks'

const open = defineModel({ required: true, default: false })
const loading = ref(false)

const handleOk = async () => {
	loading.value = true
	setTimeout(() => {
		open.value = false
		loading.value = false
	}, 2000)
}

useWatchModal(open, {
	open() {
		// console.log('open')
	},
	close() {
		// console.log('close')
	}
})
</script>
